﻿@model  AccountInitModel
@{
	ViewBag.Title = "设置密码";
	Layout = "~/Views/Shared/_Layout_Setting.cshtml";
}

@using (Html.BeginForm("InitSecond", "AccountInfo"))
{
	<div class="setting-wapper">
		<h2 class="bb">设置登陆密码</h2>
		<div class="setting-form">

			<table class="form">
				<tr>
					<td>邮箱：</td>
					<td>
						<p>
							@Model.Email
						</p>
					</td>
				</tr>
				<tr>
					<td>密码：</td>
					<td>
						<p>
							@Html.Password("password", "", new { size = 30 })
						</p>
					</td>
				</tr>
				<tr>
					<td>确认密码：</td>
					<td>
						<p>
							@Html.Password("passwordAgain", "", new { size = 30 })
						</p>
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
					<td>
						<input type="submit" value="提交" />
					</td>
				</tr>
			</table>


		</div>
	</div>  
}
@section BottomScripts {
	<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(function () {
			$("form").validate({
				rules: {
					password: {
						required: true,
						rangelength: [6, 30]
					},
					passwordAgain: {
						equalTo: "#password"
					}
				},
				messages: {
					password: {
						required: "请输入密码",
						rangelength: "密码长度为6-30位"
					},
					passwordAgain: {
						equalTo: "两次密码输入不一致"
					}
				},
				errorPlacement: function (error, element) {
					error.appendTo(element.parent().parent());
				}
			});
		});
	</script>
}